﻿<UserControl
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:thisUI="clr-namespace:VkClientIM.UI"
		xmlns:local="clr-namespace:VkClientIM"
		xmlns:taskbar="http://www.hardcodet.net/taskbar"
		x:Class="VkClientIM.MainWindow"
        Height="485" Width="270" MinWidth="270"
		Loaded="Window_Loaded">
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="Resources\GlassWindow.xaml"/>
				<ResourceDictionary Source="Resources\PinButton.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<LinearGradientBrush x:Key="BlueGradientBrush" StartPoint="0.5,0" EndPoint="0.5,1">
				<GradientStop Color="#1262BA" Offset="0"/>
				<GradientStop Color="#00015F" Offset="0.5"/>
				<GradientStop Color="#1262BA" Offset="1"/>
			</LinearGradientBrush>
				<ControlTemplate x:Key="ImageButton" TargetType="{x:Type RadioButton}">
					<Grid>
						<ContentPresenter Name="Presenter"/>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="Presenter" Property="Effect">
								<Setter.Value>
									<DropShadowEffect ShadowDepth="0" Color="{TemplateBinding Foreground}" BlurRadius="10" />
								</Setter.Value>
							</Setter>
						</Trigger>
					<Trigger Property="IsChecked" Value="True">
						<Setter TargetName="Presenter" Property="Effect">
							<Setter.Value>
								<DropShadowEffect ShadowDepth="0" Color="Blue" BlurRadius="20" />
							</Setter.Value>
						</Setter>
					</Trigger>
				</ControlTemplate.Triggers>
				</ControlTemplate>
		</ResourceDictionary>
	</UserControl.Resources>
	<Grid Background="Transparent">
		<taskbar:TaskbarIcon Name="taskbarIcon" IconSource="Resources\AppIcon.ico" 
							 MenuActivation="RightClick"
							 DoubleClickCommand="FirstPage"
							 >
			<taskbar:TaskbarIcon.ContextMenu>
				<ContextMenu>
					<Separator/>
					<MenuItem Header="Выход" Click="TaskbarExit"/>
				</ContextMenu>
			</taskbar:TaskbarIcon.ContextMenu>
		</taskbar:TaskbarIcon>
		<Border Margin="0,0,0,0" ClipToBounds="False" Background="{StaticResource GlassWindowBackground}" CornerRadius="10" BorderBrush="{StaticResource WindowFrameBrush}" BorderThickness="1,1,1,1">
			<Grid x:Name="GridWithResize">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="1"/>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="1"/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="1"/>
					<RowDefinition Height="*"/>
					<RowDefinition Height="1"/>
				</Grid.RowDefinitions>
				<Grid ClipToBounds="False" Grid.Column="1" Grid.Row="1">
					<Grid.RowDefinitions>
						<RowDefinition Height="30"/>
						<RowDefinition Height="60"/>
						<RowDefinition Height="*"/>
						<RowDefinition Height="20"/>
					</Grid.RowDefinitions>
					<Grid Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" local:DraggableBehavior.CanDrag="True">
						<DockPanel FlowDirection="RightToLeft">
							<thisUI:MinimizeButton  HorizontalAlignment="Right" VerticalAlignment="Top" Margin="10,0,0,0" Command="ApplicationCommands.Close" Height="17" />
							<DockPanel FlowDirection="LeftToRight" LastChildFill="True" >
								<ToggleButton Style="{StaticResource btnPin}" FontSize="7" Height="30" HorizontalAlignment="Left" Margin="5,0,0,0" Padding="0" VerticalAlignment="Center" Width="31" IsManipulationEnabled="False" Checked="ToggleButton_Checked" Unchecked="ToggleButton_Unchecked">
									<ToggleButton.ToolTip>
										<StackPanel>
											<TextBlock Text="Кнопка Поверх всех окон"/>
											<TextBlock Text="Включение/отключение режима всегда сверху"/>
										</StackPanel>
									</ToggleButton.ToolTip>
								</ToggleButton>
								<DockPanel  HorizontalAlignment="Stretch">
								<RadioButton Checked="RadioButton_Checked" Tag="0" Template="{StaticResource ImageButton}" IsChecked="True" DockPanel.Dock="Left">
								<Image Source="Resources\vkontakte-32x32.png" />
										<RadioButton.ToolTip>
											<StackPanel>
												<TextBlock Text="Контакт-лист"/>
												<TextBlock Text="Режим отображения cписка контактов"/>
											</StackPanel>
										</RadioButton.ToolTip>
									</RadioButton>
									<RadioButton Checked="RadioButton_Checked"  Tag="1" Template="{StaticResource ImageButton}"  DockPanel.Dock="Left">
								<Image Source="Resources\Media Player.png"/>
										<RadioButton.ToolTip>
											<StackPanel>
												<TextBlock Text="Аудиоплеер"/>
											</StackPanel>
										</RadioButton.ToolTip>
									</RadioButton>
									<RadioButton Checked="RadioButton_Checked"  Tag="2" Template="{StaticResource ImageButton}"  DockPanel.Dock="Right">
									<Image Source="Resources\Settings.png"/>
										<RadioButton.ToolTip>
											<StackPanel>
												<TextBlock Text="Быстрые настройки"/>
												<TextBlock Text="Быстрый доступ к самым важным настройкам"/>
											</StackPanel>
										</RadioButton.ToolTip>
									</RadioButton>
								<TextBlock Foreground="{StaticResource BlueGradientBrush}" FontWeight="Bold" FontSize="20"
							   HorizontalAlignment="Stretch" TextAlignment="Center" VerticalAlignment="Center" Margin="0,0" Height="30"
								Text="{Binding Title, RelativeSource={RelativeSource AncestorType={x:Type Window}, Mode=FindAncestor}}"
							   SnapsToDevicePixels="True" />
								</DockPanel>
							</DockPanel>
						</DockPanel>
						</Grid>
					<thisUI:MyProfilePresenter x:Name="profile" Grid.Row="1"/>
					<Grid Name="content" Grid.Row="2">
						<thisUI:ContactListPresenter x:Name="contacts" Margin="0,0,0,0"/>
						<thisUI:Settings x:Name="settings" Visibility="Hidden" Margin="0,0,0,0"/>
						<thisUI:AudioPlayer x:Name="audioPlayer" Visibility="Hidden" Margin="0,0,0,0"/>
					</Grid>
					<TextBlock Name="status" Grid.Row="3" Text="Статус"/>
				</Grid>
				<Thumb Opacity="0" Grid.Row="0" Grid.Column="1" Cursor="SizeNS" Tag="T" DragDelta="Thumb_DragDelta"/>
				<Thumb Opacity="0" Grid.Row="2" Grid.Column="1" Cursor="SizeNS" Tag="B" DragDelta="Thumb_DragDelta"/>
				<Thumb Opacity="0" Grid.Row="1" Grid.Column="0" Grid.RowSpan="2" Cursor="SizeWE" Tag="L" DragDelta="Thumb_DragDelta"/>
				<Thumb Opacity="0" Grid.Row="1" Grid.Column="2" Grid.RowSpan="2" Cursor="SizeWE" Tag="R" DragDelta="Thumb_DragDelta"/>
			</Grid>
		</Border>
	</Grid>
</UserControl>
